forum

Home / DeveloperSection / Forums / Can we instantiate abstract class?

Can we instantiate abstract class?

Anonymous User 1833 24-Jul-2015
abstract class my {
    public void mymethod() {
        System.out.print("Abstract");
    }
}
class poly {
    public static void main(String a[]) {
        my m = new my() {};
        m.mymethod();
    }
}
Here, I'm creating instance of my class and calling method of abstract class. Can anyone please explain this to me? 

Updated on 25-Jul-2015
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By